import request from '../axios'
// 获取某人所有的路线
export function listRoute () {
  const url = '/api/route/list'
  return request.get(url)
}

export function getRoute (id) {
  const url = '/api/route/id?id=' + id
  return request.get(url)
}

// 添加路线
export function addRoute (route) {
  const url = '/api/route/add'
  const data = {
    ...route
  }
  data.json = true
  data.Loading = true
  return request.post(url, data)
}

export function shop (userId, shopIds) {
  const url = '/api/route/shop'
  const data = { userId, shopIds }
  return request.post(url, data)
}

export function school (userId, schoolIds) {
  const url = '/api/route/school'
  const data = { userId, schoolIds }
  return request.post(url, data)
}

// 没有路线的药店
export function shopList () {
  const url = '/api/route/shop'
  return request.get(url)
}

// 没有路线的学校
export function schoolList () {
  const url = '/api/route/school'
  return request.get(url)
}
